package com.hong.concurrent.chapter10;

/**
 * @Author csh
 * @Description
 * @Date 2018/7/6 22:11
 */
public class TreadLocalSimpleTest {

    private static ThreadLocal<String> threadLocal = new ThreadLocal<String>(){
        @Override
        protected String initialValue() {
            return "Alex";
        }
    };
    //JVM start main thread
    public static void main(String[] args) throws InterruptedException {
        /*threadLocal.set("Alex");*/
        Thread.sleep(1000);
        String value = (String) threadLocal.get();
        System.out.println(value);
    }
}
